package edu.ua.jCompare;

public class TextProcessor {

	private static String puncAddSpace(String text){
		text = text.replaceAll("\\."," . ");
		text = text.replaceAll("\\?"," ? ");
		text = text.replaceAll("!"," ! ");
		text = text.replaceAll(","," , ");
		return text;
	}
	
	public static String[] splitBySpace(String text){
		text = text.replaceAll("\\s+", "\n");
		return text.split("\n");
	}
	
	public static String[] splitByPuncSpace(String text){
		text = puncAddSpace(text);
		return splitBySpace(text);
	}
}
